package com.java.simple.smallspring.context.event;

import com.java.simple.smallspring.beans.factory.BeanFactory;
import com.java.simple.smallspring.context.ApplicationEvent;
import com.java.simple.smallspring.context.ApplicationListener;

/**
 * @author zhoujunlin
 * @date 2022年08月31日 22:48
 * @desc
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {
        setBeanFactory(beanFactory);
    }

    @Override
    public void multicastEvent(ApplicationEvent event) {
        for (ApplicationListener applicationListener : getApplicationListener(event)) {
            applicationListener.onApplicationEvent(event);
        }
    }

}
